package Proofs;

import ArithmeticLibrary.Util.ArrayOfElementGroup;
import ByteTree.ByteTree;

/**
 * This class contains information about the proof of correct decryption of a single server.
 * @author Hadar Miller and Or Stern
 *
 */
public class ServerDecFact {
	
	private ArrayOfElementGroup f;
	private ByteTree gammaDec;
	private ByteTree sigmaDec;
	
	/**
	 * 
	 * @param f Array of decryption factors.
	 * @param gammaDec Commitment of the Fiat-Shamir proofs.
	 * @param sigmadec Reply of the Fiat-Shamir proofs.
	 * @throws Exception 
	 */
	public ServerDecFact(ArrayOfElementGroup f, ByteTree gammaDec, ByteTree sigmadec) throws Exception {
		
		this.f  = f;
		this.gammaDec = gammaDec;
		this.sigmaDec = sigmadec;
	}
	
	/**
	 * 
	 * @return Array of decryption factors.
	 */
	public ArrayOfElementGroup getF() {
		return f;
	}
	
	/**
	 * 
	 * @return Commitment of the Fiat-Shamir proofs.
	 */
	public ByteTree getGammaDec() {
		return gammaDec;
	}
	
	/**
	 * 
	 * @return Reply of the Fiat-Shamir proofs.
	 */
	public ByteTree getSigmaDec() {
		return sigmaDec;
	}
	
	public void setF(ArrayOfElementGroup otherF) throws Exception
	{
		for (int i = 0; i < f.length(); i++)
			f.set(i, otherF.get(i));
	}

	public void setGammaDec(ByteTree otherGammaDec)
	{
		gammaDec = otherGammaDec;
	}
	
	public void setSigmaDec(ByteTree otherSigmaDec)
	{
		sigmaDec = otherSigmaDec;
	}
}
